import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/yuan',
  component: Layout,
  redirect: '/yuan/index',
  name: 'yuan',
  meta: {
    title: '智慧园区',
    icon: 'i-heroicons-solid:menu-alt-3',
  },
  children: [
    {
      path: 'index',
      name: 'yuan',
      component: () => import('@/views/yuan/index.vue'),
      meta: {
        title: '首页',
      },
    },
    {
      path: 'park',
      name: 'Park',
      redirect: '/yuan/park/index',
      meta: {
        title: '园区管理',
      },
      children: [
        {
          path: 'index',
          name: 'building',
          component: () => import('@/views/yuan/Park/Building/index.vue'),
          meta: {
            title: '楼宇管理',
          },
        },
        {
          path: 'enterPrise',
          name: 'EnterPrise',
          // redirect: '/yuan/enterPrice/index',
          component: () => import('@/views/yuan/Park/EnterPrise/index.vue'),
          meta: {
            title: '企业管理',
          },
        },
      ],
    },

    {
      path: 'Car',
      name: 'multilevelMenuExample2',
      redirect: '/yuan/Car/index',
      meta: {
        title: '行车管理',
      },
      children: [
        {
          path: 'index',
          name: 'CarCard',
          component: () => import('@/views/yuan/Car/CarCard/index.vue'),
          meta: {
            title: '月卡管理',
          },
        },
        {
          path: 'carrule',
          name: 'CarRule',
          component: () => import('@/views/yuan/Car/CarRule/index.vue'),
          meta: {
            title: '计费规则管理',
          },
        },
      ],
    },
  ],
}

export default routes
